require "src.class"
GameRole = class("GameRole")

-- 构造函数
function GameRole:ctor(id, name, modelId, atk, def)
    name = name or '未命名角色'
    modelId = modelId or '10000'
    atk = atk or 10
    def = def or 2

    self.id = id
    self.name = name
    self.modelId = modelId
    self.atk = atk
    self.def = def
end

-- tostring
function GameRole:__tostring()
    return ("Role id:"..self.id.." name:"..self.name.." modelId:"..self.modelId.." atk:"..self.atk.." def:"..self.def)
end